package com.qingcheng.dao;

import com.qingcheng.pojo.user.UserPandect;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserPandectMapper {

    @Select("SELECT (SELECT COUNT(*) FROM tb_user WHERE created > #{date2} AND created <= #{date1}) today_add_sum,\n" +
            "(SELECT COUNT(*) FROM tb_user WHERE created > #{date3} AND created <= #{date2}) yesterday_add_sum,\n" +
            "(SELECT COUNT(*) FROM tb_user WHERE created > #{date4} AND created <= #{date1}) month_add_sum,\n" +
            "(SELECT COUNT(*) FROM tb_user) vip_sum")
    public UserPandect findUser(@Param("date1")String date1, @Param("date2")String date2, @Param("date3")String date3, @Param("date4")String date4);
}
